<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>学生注册</title>
<script>
	function setColor() {
		var table = document.getElementsByClassName("wwFormTable")[0];
		var rgb = document.getElementById("rgb");
		//alert(rgb.value);
		table.style.backgroundColor="rgb("+ rgb.value+")";
	}
</script>	
</head>
<body onload="setColor()">
	<s:form action="addStudent">
		<s:textfield name="student.id" key="student.id"></s:textfield>
		<s:textfield name="student.name" key="student.name"></s:textfield>
		<s:textfield name="student.age" key="student.age"></s:textfield>
		<s:textfield id="rgb" name="student.rgb" key="RGB" onchange="setColor()"></s:textfield>
		<s:radio list="#{'male':'男','female':'女' }" key="gender"
			name="student.gender" value="student.gender"></s:radio>
		<s:textfield name="student.birthday" key="birthday">
			<s:param name="value">
				<s:date name="student.birthday" format="yyyy-mm-dd" />
			</s:param>
		</s:textfield>
		<s:updownselect key="favorite"
			list="#{'math':'数学','chinese':'大学语文','english':'英语' }"
			name="student.favorite" value="student.favorite"></s:updownselect>
		<s:submit value="注册"></s:submit>
	</s:form>
</body>
</html>